import React from 'react'

import Icon from '../icon/Icon'
import {CellWrapper} from './styledCell'

export default function Cell(
{
    title,
    value,
    right,
    height,
    bgColor,
    border,	//是否显示内边框
    click, //点击时触发
    clickRight,
    leftArrow //时候显示右侧箭头
}
) {
    return (
        <CellWrapper
        height = {height}
        bgColor = {bgColor}
        border = {border}
        onClick = {click}
        >
            <div className='title'>
                {title}
            </div>
            <div className='value'>
                {value}
            </div>
            <div className='right' onClick = {clickRight}>
                {
                    right ?(
                            right
                        
                    ):(
                        leftArrow && <Icon color='#ccc' name='arrowRightLine' size = '.18rem'></Icon>
                    )
                }
            </div>
            
            
        </CellWrapper>
    )
}

Cell.defaultProps = {
    leftArrow: false,
    border: false,
    bgColor: '#fff',
    height: '.4rem'
}